/*************************************************************************
> File Name: 1.c
> Author: hzy
> Created Time: 2023-07-24 15:22:53
> Description: 1、求一个字符串的长度。(指针)
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char const *argv[])
{
    char buf[] = {"abcdefg"};
    char *p = buf;
    int buf_len = 0;

    while (*p++ != '\0')
    {
        buf_len++;
    }
    printf("字符串的长度为：%d\n",buf_len);

    return 0;
}